package com.by.feign.fallback;

import com.by.feign.client.UserRemoteClient;
import com.by.feign.dto.UserDto;
import com.by.result.Result;
import com.by.result.ResultCode;
import org.springframework.stereotype.Component;


@Component
public class UserRemoteClientFallback implements UserRemoteClient {


    /**
     * feign 调用  降级处理
     * @param id 用户id
     * @return 用户信息
     */
    @Override
    public Result<UserDto> getUserById(int id) {
        return Result.error(ResultCode.SELECT_USER_FAILED,"查询用户信息失败");
    }
}
